package com.atguigu.gulimall.ware.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 采购信息
 * 
 * @author GuanMing.Zhu
 * @email xiaoming.080797@gmail.com
 * @date 2021-05-09 20:45:37
 */
@Data
@TableName("wms_purchase")
@NoArgsConstructor
@AllArgsConstructor
public class PurchaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@TableId
	private Long id;
	/**
	 * 
	 */
	private Long assigneeId;
	/**
	 * 
	 */
	private String assigneeName;
	/**
	 * 
	 */
	private String phone;
	/**
	 * 
	 */
	private Integer priority;
	/**
	 * 采购单状态[0 - 新建，1 - 已分配，2 - 已领取，3 - 已完成，4 - 有异常]
	 */
	private Integer status;
	/**
	 * 
	 */
	private Long wareId;
	/**
	 * 
	 */
	private BigDecimal amount;
	/**
	 * 
	 */
	private Date createTime;
	/**
	 * 
	 */
	private Date updateTime;

	public PurchaseEntity(Long purchaseId, Date date) {
		this.id = purchaseId;
		this.updateTime = date;
	}

	public PurchaseEntity(Integer code) {
		this.status = code;
	}

	public PurchaseEntity(Long purchaseId, Integer code) {
		this.updateTime = new Date();
		this.id = purchaseId;
		this.status = code;
	}

	public PurchaseEntity initDate() {
		this.createTime = new Date();
		this.updateTime = new Date();
		return this;
	}
}
